import axios from '@/axios'

// 登录方法
export function loginAPI(data) {
  return axios({
    url: '/auth/login',
    headers: {
      isToken: false,
    },
    method: 'post',
    data,
  })
}

// PC和App登录方法
export function loginAppAPI(data) {
  return axios({
    url: '/auth/app/login',
    headers: {
      isToken: false,
    },
    method: 'post',
    data,
  })
}

// 注册方法
export function register(data) {
  return axios({
    url: '/auth/register',
    headers: {
      isToken: false,
    },
    method: 'post',
    data: data,
  })
}

// 刷新方法
export function refreshToken() {
  return axios({
    url: '/auth/refresh',
    method: 'post',
  })
}

// 获取用户详细信息
export function getInfo() {
  return axios({
    url: '/system/user/getInfo',
    method: 'get',
  })
}

// 退出方法
export function logout() {
  return axios({
    url: '/auth/logout',
    method: 'delete',
  })
}

export function getTicket2() {
  return axios({
    url: '/system/user/getTicket',
    method: 'get',
  })
}
